$(document).ready(function(){

    var num_traitement = $(document).find('#num_traitement').text();

    var cookieName = 'accordionTraitementShow';
    
    var accordion = $( "#accordion" ).accordion({
        collapsible: true,
        autoHeight: false,
        active: ( $.cookies.get( cookieName ) || 0 ),
        change: function( e, ui )
        {
            $.cookies.set( cookieName, $( this ).find( 'h3' ).index ( ui.newHeader[0] ) );
        }
    });
    
    
    
    $( ".deleteFaisceau" ).click(function(event) {
        event.preventDefault();
        var numRayon = $(this).attr('id').split('_')[1];
        var hrefDel = $(this).attr('href'); 
        
        $("#dialogDeleteFaisceau_"+numRayon).dialog({
            resizable: false,
            modal: true,
            buttons: {
                "Supprimer ce faisceau": function() {
                    window.location = hrefDel;
                    return false;
                },
                "Annuler": function() {
                    $(this).dialog( "close" );
                    return false;
                }
            }
        });
    });
    
});


